<?php

namespace app\models;

use Yii;

/**
 * Course is the ActiveRecord behind the contact form.
 */
class CourseInfo extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'b_course_info';
    }
    /**
     * @return array the validation rules.
     */
    public function rules()
    {
        return [
            [['id', 'name', 'content', 'course_type', 'course_keyword', 'total_hour', 'major_id', 'major_name', 'school', 'school_name'], 'required'],
            [['id', 'school', 'major_id', 'create_by', 'update_by', 'group_id'], 'string', 'max' => 36],
            [['name', 'course_code', 'base_knowledge', 'image_url', 'course_tier','old_id'], 'string', 'max' => 255],
            [['study_plan', 'study_require', 'exam_plan'], 'string', 'max' => 2048],
            [['image', 'discount_cent', 'course_source_from', 'is_public'], 'integer'],
            [['price'], 'number'],
        ];
    }

    /**
     * @return array customized attribute labels
     */
    public function attributeLabels()
    {
        return [
            'name' => 'Name',
        ];
    }
}
